/**
 * Copyright 2011 FeedDreamwork SIG
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package org.feeddreamwork.feed;

import java.util.*;

import org.feeddreamwork.*;

public class Entry implements Cloneable {
	private String title;
	private String link;
	private String content;
	private String author;
	private Date updatedTime;

	public Entry(String title, String link, String content, String author,
			Date updatedTime) {
		setTitle(title);
		setLink(link);
		setContent(content);
		setAuthor(author);
		setUpdatedTime(updatedTime);
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		Utils.throwIfNullOrEmpty(title);
		this.title = title;
	}

	public String getLink() {
		return link;
	}

	public void setLink(String link) {
		Utils.throwIfNullOrEmpty(link);
		this.link = link;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		Utils.throwIfNullOrEmpty(author);
		this.author = author;
	}

	public Date getUpdatedTime() {
		return updatedTime;
	}

	public void setUpdatedTime(Date updatedTime) {
		Utils.throwIfNull(updatedTime);
		this.updatedTime = updatedTime;
	}

	@Override
	public Entry clone() {
		return new Entry(title, link, content, author, updatedTime);
	}
}
